package top.eggcode.modules.log.store;

import org.springframework.stereotype.Repository;
import top.eggcode.component.query.CriteriaBuilder;
import top.eggcode.component.query.model.PageList;
import top.eggcode.modules.log.model.ExceptionLogEntity;
import top.eggcode.modules.log.model.ExceptionLogQuery;

import javax.annotation.Resource;

/**
 * Title:
 * Description: TODO
 * Date: 2021/9/19 14:57
 *
 * @author JiaQi Ding
 * @version 1.0
 */
@Repository
public class ExceptionLogStore {

    @Resource
    private CriteriaBuilder builder;

    public PageList<ExceptionLogEntity> page(ExceptionLogQuery query) {
        return builder.createQuery(ExceptionLogEntity.class)
                .select()
                .fromEntity("root")
                .fetchPage(query);

    }

}
